$(function(){
	var newCourse=[];
	var newsAd=[];
	var collAd=[];
	var vmMain=new Vue({
	    el: '#contentBody',
		data:{
			courseList:newCourse,
			newsAdList:newsAd,
			collAdList:collAd,
		}
     });
   $.ajax({
	    url : 'pages/notice',
	    type : 'POST',
	    dataType : 'json',
        data : {pageIndex:0,pageCount:8},
 	    success : function(result)
 	    {	
 	    	for(var i=0;i<result.length;i++)
 	    	{
 	    		if(result[i].type=="学院公告")
    			{
    			    result[i].typeNmae='学院公告';
    			    result[i].nType=1;
    			}
 	    		else
 	    		{
 	    			result[i].typeNmae='系统信息';
 	    			result[i].nType=2;
 	    		}
 	    		 vmMain.collAdList.push(result[i]);
 	    	}
	    },
	    error:function(result)
	    {
 	    	return;
	    }	
    });
   $.ajax({
	    url:"pages/subjects",
	    type:"POST",
	    dataType:"json",
        data:{pageIndex:0,pageCount:8},
	    success:function(result)
	    {	
	    	if(result)
	    	{
	    		for(var i=0;i<result.length;i++)
	    		{
	    			result[i].image="\\atta\\"+result[i].image;
	    		}
	    	}
	    	vmMain.courseList=result;
	    },
	    error:function(result){
	    	
	    	return;
	    }
   });
   
   $.ajax({
	    url:"pages/new",
	    type:"POST",
	    dataType:"json",
        data:{pageIndex:0,pageCount:8},
	    success:function(result)
	    {	
	    	vmMain.newsAdList=result;
	    },
	    error:function(result)
	    {
   	        alert(result.msg);
	    	return;
	    } 	
   });
});